]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
build: Remove Soup2 support
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 24 May 2023 15:09:55 +0000 (17:09 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 26 May 2023 19:05:22 +0000 (19:05 +0000)
We started to support Soup3 in GNOME 41, and used it by default
since GNOME 43. This should be enough time for distros to adapt,
so GNOME 45 looks like a good moment to drop the old Soup2 support.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2776>

js/misc/config.js.in
js/misc/meson.build
js/ui/environment.js
meson.build
meson_options.txt

index 8ef427037bb8770ebad352d6b04d5fd1adb4ceb5..5684ef69c37067e397566eba246330c05d47f73b 100644 (file)
@@ -7,8 +7,6 @@ var PACKAGE_NAME = '@PACKAGE_NAME@';
 var PACKAGE_VERSION = '@PACKAGE_VERSION@';
 /* 1 if networkmanager is available, 0 otherwise */
 var HAVE_NETWORKMANAGER = @HAVE_NETWORKMANAGER@;
-/* 1 if soup2 should be used instead of soup3, 0 otherwise */
-var HAVE_SOUP2 = @HAVE_SOUP2@;
 /* gettext package */
 var GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
 /* locale dir */
index 2dff20decf6393eaac6ad7faeef7e24136942716..5aceefac42e1fb77ea71830dc90d325147a121e9 100644 (file)
@@ -4,7 +4,6 @@ jsconf.set('PACKAGE_VERSION', meson.project_version())
 jsconf.set('GETTEXT_PACKAGE', meson.project_name())
 jsconf.set('LIBMUTTER_API_VERSION', mutter_api_version)
 jsconf.set10('HAVE_NETWORKMANAGER', have_networkmanager)
-jsconf.set10('HAVE_SOUP2', have_soup2)
 jsconf.set('datadir', datadir)
 jsconf.set('libexecdir', libexecdir)
 
index 353cd35f631879b647b4c395559b2e38c9a61188..09c9f031dcdd81759f49cbf2bda1f8589990da99 100644 (file)
@@ -33,16 +33,6 @@ imports.gi.versions.TelepathyGLib = '0.12';
 imports.gi.versions.TelepathyLogger = '0.2';
 imports.gi.versions.UPowerGlib = '1.0';
 
-try {
-    if (Config.HAVE_SOUP2)
-        throw new Error('Soup3 support not enabled');
-    const Soup_ = imports.gi.Soup;
-} catch (e) {
-    imports.gi.versions.Soup = '2.4';
-    const { Soup } = imports.gi;
-    _injectSoup3Compat(Soup);
-}
-
 const {Clutter, Gdk, Gio, GLib, GObject, Meta, Polkit, Shell, St} = imports.gi;
 const Gettext = imports.gettext;
 const System = imports.system;
@@ -101,42 +91,6 @@ function _patchLayoutClass(layoutClass, styleProps) {
     }
 }
 
-/**
- * Mimick the Soup 3 APIs we use when falling back to Soup 2.4
- *
- * @param {object} Soup 2.4 namespace
- * @returns {void}
- */
-function _injectSoup3Compat(Soup) {
-    Soup.StatusCode = Soup.KnownStatusCode;
-
-    Soup.Message.new_from_encoded_form =
-        function (method, uri, form) {
-            const soupUri = new Soup.URI(uri);
-            soupUri.set_query(form);
-            return Soup.Message.new_from_uri(method, soupUri);
-        };
-    Soup.Message.prototype.set_request_body_from_bytes =
-        function (contentType, bytes) {
-            this.set_request(
-                contentType,
-                Soup.MemoryUse.COPY,
-                new TextDecoder().decode(bytes.get_data()));
-        };
-
-    Soup.Session.prototype.send_and_read_async =
-        function (message, prio, cancellable, callback) {
-            this.queue_message(message, () => callback(this, message));
-        };
-    Soup.Session.prototype.send_and_read_finish =
-        function (message) {
-            if (message.status_code !== Soup.KnownStatusCode.OK)
-                return null;
-
-            return message.response_body.flatten().get_as_bytes();
-        };
-}
-
 function _makeEaseCallback(params, cleanup) {
     let onComplete = params.onComplete;
     delete params.onComplete;
index 7b08fe52d596060c30ca232d71ab057db644c5af..dd033748693c465b0fe065a799f6eefcbaa5fd99 100644 (file)
@@ -112,8 +112,6 @@ else
   have_systemd = false
 endif
 
-have_soup2 = get_option('soup2')
-
 if get_option('man')
   if fs.exists('man/gnome-shell.1')
     install_man('man/gnome-shell.1')
index 46ca8e785e07ae5e2aac7debf2682efc544c7a82..2d317e602fce9f30340825a766920f83a612cb6f 100644 (file)
@@ -39,9 +39,3 @@ option('systemd',
   value: true,
   description: 'Enable systemd integration'
 )
-
-option('soup2',
-  type: 'boolean',
-  value: false,
-  description: 'Use Soup 2.4 instead of Soup 3. Must be in sync with libgweather'
-)